how to minimize complexity in codebase c